<script type="text/javascript">

var fdHash = new Array();

f_info = [159, 160, 236, 237];
f_task = [234, 235];
f_comm = [191];
f_soc  = [213];

d_info = [178, 233, 227, 223, 206, 171, 205, 211, 226, 170, 203, 189, 207, 208, 228, 183, 158, 238, 204, 225, 172, 180, 161, 231, 162, 167, 217, 222, 215, 240];
d_task = [179, 190, 239];
d_comm = [182, 165, 169];
d_soc = [199, 229, 224, 174, 175, 176, 181, 177];

fdHash[159] = d_info; // Info_Request_(Open)
fdHash[160] = d_info; // Info_Provision
fdHash[236] = d_info; // Info_Request_(Closed)
fdHash[237] = d_info; // Info_Request_(Other)

fdHash[234] = d_task; // Task_Provision
fdHash[235] = d_task; // Task_Request

fdHash[191] = d_comm  // Dialogue_Mgmt
fdHash[201] = []      // Typo / Uninterpretable
fdHash[213] = d_soc   // Relationship_Mgmt
fdHash[192] = []      // Log:Disconnect

fdHash[182] =   f_comm; // Comm:Channel
fdHash[165]	=   f_comm; // Comm:Feedback
fdHash[169] =   f_comm; // Comm:Pausing
fdHash[178] =	f_info; // Feedback:Info_Object
fdHash[233] =	f_info; // Feedback:Librarian
fdHash[227] =	f_info; // Feedback:Problem_Description
fdHash[223] =	f_info; // Feedback:Search_Strategy
fdHash[206] =	f_info; // Info_Obj:Access
fdHash[171] =	f_info; // Info_Obj:Description
fdHash[205] =	f_info; // Info_Obj:Direct_Answer
fdHash[211] =	f_info; // Info_Obj:Excerpt
fdHash[226] =	f_info; // Info_Obj:Opinion
fdHash[170] =	f_info; // Info_Obj:Reference
fdHash[203] =	f_info; // Info_Obj:Source
fdHash[189] =	f_info; // Other:Librarian
fdHash[207] =	f_info; // Other:Library
fdHash[208] =	f_info; // Other:System
fdHash[228] =	f_info; // Other:Unknown
fdHash[183] =	f_info; // Other:User_
fdHash[158] =	f_info; // Problem:Background
fdHash[238] =	f_info; // Problem:Librarian_Understanding
fdHash[240] =	f_info; // Problem:Lib Knowledge
fdHash[204] =	f_info; // Problem:Location
fdHash[225] =	f_info; // Problem:People
fdHash[172] =	f_info; // Problem:Status
fdHash[180] =	f_info; // Problem:Time
fdHash[161] =	f_info; // Problem:Topic
fdHash[231] =	f_info; // Problem:User_Knowledge
fdHash[162] =	f_info; // Problem:_Info_Type
fdHash[167] =	f_info; // Problem:_Previous_Reference
fdHash[217] =	f_info; // Search:Librarian_Progress
fdHash[222] =	f_info; // Search:Strategy
fdHash[215] =	f_info; // Search:User_Progress
fdHash[199] =	f_soc; // Social:Apology
fdHash[229] =	f_soc; // Social:Closing_Ritual
fdHash[224] =	f_soc; // Social:Downplay
fdHash[174] =	f_soc; // Social:Exclamation
fdHash[175] =	f_soc; // Social:Gratitude
fdHash[176] =	f_soc; // Social:Greeting
fdHash[181] =	f_soc; // Social:Rapport_Building
fdHash[177] =	f_soc; // Social:Valediction
fdHash[179] =	f_task; // Task: Librarian
fdHash[190] =	f_task; // Task: User
fdHash[239] =	f_task; // Task: Other


function updateOptions(options, selection)
{
	var numAvails = 0;
	var lastAvail = null;
	
	for (var i = 0; i < options.length; i++) 
    {
		// if "Please Select" is selected, enable all options
		// also, "Please select" is always shown
		
		if (options[i].value == "null")
		{
			options[i].disabled = false;
			numAvails += 1;
		} 
		else if (selection == "null")
		{
			options[i].disabled = false;
			numAvails += 1;
		} 
		else 
		{
    		var domains = fdHash[parseInt(selection)];
    		var domain = parseInt(options[i].value);
    		  
    		if (domains.indexOf(domain) == -1)
    		{
    		 options[i].disabled = true;
    		} 
    		else 
    		{
    		  options[i].disabled = false;
    		  numAvails += 1;
    		  lastAvail = options[i];
    		}    			  
    	 }
    }     
   if (numAvails == 2) // "Please select" is always available.
     lastAvail.selected = true;
}

function functionChanged()
{  
      var options = document.form_da.domain.options;
      var selection = document.form_da.function.value;
       updateOptions(options, selection)
}

function domainChanged()
{
      var options = document.form_da.function.options;
      var selection = document.form_da.domain.value;
      updateOptions(options, selection)
}
</script>
